import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './index.less'
import {
  Carousel,Toast,Icon
} from 'antd-mobile'
import {Link} from 'react-router'
import { devUrl} from 'SERVICE/xhr/config';

export default class Banner extends Component {
	static contextTypes = {
      router: PropTypes.object.isRequired
    }
	constructor(props) {
		super(props);
		this.state = {

		}
	}



	render() {
		let {bannerList} = this.props;
		let banner = bannerList.map((item, index)=>{

    	let display = item.detailUrl==''?'none':'block'
			return (
			    <Link  style={{height: `3.62rem`,float:'left',width:'100%'}} >
			       <img src={'./imgs/'+item.cover} alt="" width="100%" height="100%" data-id={item.messageId}/>
			       <span className='imgTitle' data-id={item.messageId}>{item.title}</span>
			    </Link>
			)
		})
		return (
			<Carousel autoplay={true} infinite style={{height: `3.62rem`}}>
           		{banner}
          	</Carousel>
		)
	}
}